home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
176-200
/
scopedisk196
/
colordemo
/
colors.bas
< prev
next >
Wrap
BASIC Source File
|
1995-03-19
|
2KB
|
92 lines
rem $event on
rem $option b
rem $option e
rem $option w
rem $option a
rem $option v
rem $option u
rem $option n
rem $option l-
defint a - z
screen 1 , 640 , 400 , 4 , 4
window 1,"colordemo...Gerald Faver", ( 0 , 0 )-( 631 , 386 ), 30 ,1
defint a-z
grid_parameters:
top_x = 171 : top_y = 91 : bot_x = 630 : bot_y = 380
line ( top_x , top_y ) - ( bot_x , bot_y ) , 1 , b 'grid 17 high , 27 across
draw_grid:
doin_it = - 1
os = 100 ' experiment around with where to put 'em
for x = 0 to 15
line (x*10 + 1 , 1 + os) - (x*10 + 10 , 10 + os) ,x,bf
line (x*10 + 1 , 20 + os) - (x*10 + 10 , 30 + os) ,x,bf
line (x*10 + 1 , 40 + os) - (x*10 + 10 , 50 + os) ,x,bf
line (x*10 + 1 , 60 + os) - (x*10 + 10 , 70 + os) ,x,bf
next
while doin_it
locate 2 , 20
m =mouse(0)
if m and mouse(1) <= 160 then
if mouse(2) >= os and mouse(2) <= os + 10 then
chce1 = point(mouse(1),mouse(2))
? "choice 1=";chce1
end if
if mouse(2) >= 20 + os and mouse(2) <= 30 + os then
chce2 = point(mouse(1),mouse(2))
? tab(35) "choice 2=";chce2
end if
if mouse(2) >= 40 + os and mouse(2) <= 50 + os then
? tab(50)"choice 3=";chce3
chce3 = point(mouse(1),mouse(2))
end if
if mouse(2) >= 60 + os and mouse(2) <= 70 + os then
? tab(65)"choice 4=";chce4
chce4 = point(mouse(1),mouse(2))
end if
end if
if m then
ask_box mouse(1) , mouse(2)
else
sleep
end if
m = 0
wend
window close 1
sub draw_box (x! , y! , colr_1 , colr_2 , colr_3 , colr_4)
shared top_x , top_y
local i , j , x_pix , y_pix
x_pix = x!-top_x : x_pix = x_pix/8+.5
y_pix = y!-top_y : y_pix = y_pix/8+.5
pset (x_pix,y_pix),colr_1: pset (x_pix + 1,y_pix) , colr_2
pset (x_pix,y_pix +1),colr_3 : pset (x_pix+1,y_pix+1) , colr_4
for i = x! to x! + 15 step 2
for j = y! + 1 to y! + 16 step 2
pset (i,j ),colr_1 : pset (i + 1,j) , colr_2
pset (i,j +1),colr_3 : pset (i+1,j+1) , colr_4
next j , i
end sub
sub ask_box (x , y ) static
shared top_x , top_y , bot_x , bot_y , chce1 , chce2 , chce3 , chce4
local gx , gy , grd_x , grd_y , x_pixel , y_pixel
if mouse(0) <> - 1 then exit sub
if x >= top_x and x <= bot_x - 8 then
if y >= top_y and y <= bot_y then
gx = x - top_x : gx = gx / 17 + .5
gy = y - top_y : gy = gy / 17 + .5
grd_x = top_X + gx * 17
grd_y = top_y + gy * 17
draw_box grd_x - 17 , grd_y-17 , chce1 , chce2 , chce3 , chce4
end if
end if
end sub